<?php
/**
 * Description of loginclass
 *
 * @author Arco
 */
class Login {

    var $username;
    var $password;
    var $id;

    var $dead=false;
    var $melding;

    function logincheck($username, $password) {
        global $qm;
        $this->melding = "Fill the fields correct in.<br />";
        $this->username=$username;
        $this->password=md5($password);
        $this->id=$qm->getIdByPassAndUser($this->username, $this->password);
        if($this->id==false){
           $this->melding .= "The username and the password do not connect<br />";
        }else {
            $_SESSION['userid']=$this->id;
            header("location: /game/");
        }
        return $this->melding;
        /**
         * @todo meldingclass maken
         */
    }
}
?>
